package icasue.webdashboard.apptree.execute;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2021/1/28 下午7:42
 * @UpdateDate:
 * @Description: 执行单元
 */
@Data
public class ExecuteMetadata {
    //方法描述
    String functionDescription;
    //调度对象类名
    String className;
    //调度的方法名
    String methodName;
    //形参表列以及参数值
    List<ExecuteMetadata.ParamMetadata> params;
    //请求响应
    Object response;
    //执行策略
    Integer strategy = 0;
    @Data
    public static class ParamMetadata{
        Integer paramIdx;
        String paramDoc;
        String paramClassName;
        Object paramValue;
    }

    /**
     * 执行结果集
     */
    @Data
    public static class ExecuteResult{
        public String hostPort;
        public Boolean success = Boolean.TRUE;
        public Object result;
    }

    @Data
    public static class ClusterExecuteResult{
        public Boolean success = Boolean.TRUE;
        public List<ExecuteResult> node = new ArrayList<>();
    }
}
